#!/usr/bin/env ruby

# 
# Data sources
compile '/filesystem_customizable/' do
  filter 'erb'
  layout 'default'
end
route '/filesystem_customizable/' do
  "/data_sources" + item.identifier.chop + ".html"
end

# 
# Filters
compile '/svg2png/wolf/' do
  filter 'svg_to_png', {
    :background_color => "#000",
    :width => 600
  }
end
compile '/svg2png/*' do
  filter :svg_to_png
end
route '/svg2png/*' do
  "/filters" + item.identifier.chop + ".png"
end

compile '/crop/*' do
  filter :crop,
         :x => 0,
         :y => 0,
         :width => "image.columns - 300",
         :height => "image.rows - 400"
end
route '/crop/*' do
  "/filters" + item.identifier.chop + '.' + item[:extension]
end

compile '/beautify/' do
  filter :beautify
  layout 'default'
end
route '/beautify/' do
  "/filters" + item.identifier.chop + ".html"
end

compile %r{^/sprockets/[^_]+$} do
  filter :sprockets, 
         :load_path => ["src/filters/sprockets/partials"],
         :strip_comments => false
  filter :yuicompressor, :type => :js
end
route %r{^/sprockets/[^_]+$} do
  "/filters" + item.identifier.chop + ".js"
end



compile '*' do
  puts "Silented: #{item.identifier}"
end
route '*' do;end
layout '*', :erb
